<!doctype html>
<html lang="ja">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="/assets/manage.css" type="text/css" />
</head>
<body>
	
<? if(isset($description)) { ?>
	<?= $description; ?><br />
<? } ?>	
<? if(isset($error)) { ?>
	<font color='red'><?= $error; ?></font><br />
<? } ?>	

<a href="/manage/reward/list">一覧を更新</a>
　
<a href="?csv=1">CSV(右クリックで保存)</a>
　｜　
<a href="/manage/reward/input">入力して追加</a>
　
APIから追加
 <a href="/manage/reward/api/appdrv">AppDriver</a>
 <a href="/manage/reward/api/ca">CAリワード</a>
 <a href="/manage/reward/api/smaad">SMAAD</a>
 <a href="/manage/reward/api/affile">Affilead</a>
<hr>

<table>
<tr>
<td>広告ID</td>
<td>取得日</td>
<td>報酬</td>
<td>icon</td>
<td>タイトル</td>
<td>簡易獲得条件</td>
<td>獲得条件</td>
<td>注意事項</td>
<td>詳細説明</td>
<td>カテゴリ</td>
<td>優先度</td>
<td>審査中</td>
<td>操作</td>
</font>
<? foreach($list as $row => $col) { ?>
<tr>
<form action='/manage/reward/list/' method='post'>
	<input type='hidden' name='action' value='edit'> 
<td><?= $col['ad_company']; ?><br /><?= $col['ad_id']; ?></td>
<td><?= substr($col['post_date'],5,5); ?><br><?= substr($col['post_date'],11,5); ?></td>
<td>¥<?= $col['payment']; ?><br><?= $col['point']; ?>pt</td>
<td><img src='<?= $col['icon']; ?>' width=64 height=64></td>
<td><textarea name='title' cols=10 rows=4><?= $col['title']; ?></textarea></td>
<td><textarea name='subtitle' cols=10 rows=4><?= $col['subtitle']; ?></textarea></td>
<td><textarea name='advertisement' cols=13 rows=4><?= $col['advertisement']; ?></textarea></td>
<td><textarea name='notice' cols=15 rows=4><?= $col['notice']; ?></textarea></td>
<td><textarea name='description' cols=13 rows=4><?= $col['description']; ?></textarea></td>
<td><input type='text' name='category' value='<?= $col['category']; ?>' size=5></td>
<td><input type='text' name='score' value='<?= $col['score']; ?>' size=3></td>
<td <?= $col['review'] == 1 ? 'bgcolor="#ffcccc"' : ''; ?>>
	<select name="review" value="0">
		<option value="0" <?= $col['review'] == 0 ? 'selected' : ''; ?>>隠す</option>
		<option value="1" <?= $col['review'] == 1 ? 'selected' : ''; ?>>表示</option>
	</select>
</td>
<td>
	<input type='hidden' name='reward_id' value='<?= $col['reward_id']; ?>'> 
	<input type="submit" value="変更">
</form>
<form action='/manage/reward/input/' method='post'>
	<input type='hidden' name='reward_id' value='<?= $col['reward_id']; ?>'> 
	<input type="submit" value="詳細">
</form>
<form action='/manage/reward/list/' method='post'>
	<input type='hidden' name='action' value='delete'> 
	<? foreach($col as $k => $v) { ?>
	<input type='hidden' name='<?= $k; ?>' value='<?= htmlspecialchars($v); ?>'> 
	<? } ?>
	<input type="submit" value="削除">
</form>
</td>
</tr>
<? } ?>	
</table>

</body>
</html>